import {
	post,
	get,
	put,
} from '@/utils/request.js'

/**
 * 首页活动列表
 */
export const pageIndexActiveApi = (params) => {
	return get('/active/pageIndexActive', params)
}

/**
 * 活动详情
 */
export const activeDetailsApi = (id) => {
	return get(`/active/details?id=${id}`)
}

/**
 * 活动收藏/取消收藏
 */
export const activeCollectUpdateStateApi = (data) => {
	return put('/activeCollect/updateState', data)
}

/**
 * 获取商户的联系方式（只限于团购活动的非多商户商品）
 */
export const getCustomInfoApi = (merchantId) => {
	return get(`/active/getCustomInfo?merchantId=${merchantId}`)
}

/**
 * 获取商品券的使用说明和可用商户
 */
export const getUseDetailsApi = (goodsId) => {
	return get(`/active/useDetails?activeGoodsId=${goodsId}`)
}

/**
 * 创建活动选择商品列表
 */
export const getGoodsActiveApi = (data) => {
	return get('/goods/pageGoodsActive', data)
}
